//package com.ycy.skip;
//
//import com.ycy.BaseTest;
//import org.flowable.engine.HistoryService;
//import org.flowable.engine.RepositoryService;
//import org.flowable.engine.RuntimeService;
//import org.flowable.engine.TaskService;
//import org.flowable.engine.repository.Deployment;
//import org.flowable.engine.runtime.ProcessInstance;
//import org.flowable.task.api.Task;
//import org.flowable.task.api.history.HistoricTaskInstance;
//import org.junit.Test;
//
//import java.util.*;
//
//public class SkipExpression extends BaseTest {
//
//  @Test
//  public void creatProcDef() {
//    // 部署流程
//    RepositoryService repositoryService = processEngine.getRepositoryService();
//    Deployment deployment = repositoryService.createDeployment()
//            .addClasspathResource("juel/h.bpmn20.xml")
//            .deploy();
//    System.out.println(deployment);
//  }
//
//  @Test
//  public void createProcInst() {
//    RuntimeService runtimeService = processEngine.getRuntimeService();
//    HashMap<String, Object> variables = new HashMap<>();
//    List<String> zhixingrens = new ArrayList<>();
//    zhixingrens.add("ycy");
//    zhixingrens.add("xdm");
//    variables.put("ASSIGNEE_zhixingren1_LIST", zhixingrens);
//
//    variables.put("_FLOWABLE_SKIP_EXPRESSION_ENABLED", true);
//
//    ProcessInstance processInstance =
//            runtimeService.startProcessInstanceByKey("skiping", variables);
//    System.out.println(processInstance.getProcessInstanceId());
//  }
//
//  public static final String ACTIVITY_SKIP_ENABLE_KEY = "_FLOWABLE_SKIP_EXPRESSION_ENABLED";
//
//  /**
//   * 测试bpmn中的，activiti:skipExpression
//   */
//  @Test
//  public void createProcInst2() {
//    RuntimeService runtimeService = processEngine.getRuntimeService();
//    HashMap<String, Object> variables = new HashMap<>();
//    List<String> zhixingrens = new ArrayList<>();
//    zhixingrens.add("ycy");
//    zhixingrens.add("xdm");
//    variables.put("ASSIGNEE_zhixingren1_LIST", zhixingrens);
//
//    Set<String> rdfa_passed_tasks = new HashSet<>();
//    rdfa_passed_tasks.add("B");
//    //userTaskDefKey rdfa_passed_task
//    variables.put("rdfa_passed_task", rdfa_passed_tasks);
////    variables.put("_ACTIVITI_SKIP_EXPRESSION_ENABLED", true);
//    variables.put(ACTIVITY_SKIP_ENABLE_KEY, true);
//
//    List<String> zhixingrenss = new ArrayList<>();
//    zhixingrenss.add("ycyC");
//    zhixingrenss.add("xdmC");
//    variables.put("ASSIGNEE_zhixingren2_LIST", zhixingrenss);
//
//    ProcessInstance processInstance =
//            runtimeService.startProcessInstanceByKey("skiping", variables);
//    String processInstanceId = processInstance.getProcessInstanceId();
//    System.out.println(processInstanceId);
//  }
//
//  /**
//   * 查询流程实例下的所有任务
//   */
//  @Test
//  public void queryProcessInstanceIdTask() {
//    TaskService taskService = processEngine.getTaskService();
//    //获取流程实例中的task
//    List<Task> list = taskService.createTaskQuery().processInstanceId("25001").list();
//    for (Task task : list) {
//      System.out.println(task);
//      //查询所有参数
//      Map<String, Object> variables = taskService.getVariables(task.getId());
//      System.out.println(variables);
//    }
//  }
//
//  /**
//   * 查询流程实例下的所有任务
//   */
//  @Test
//  public void queryProcessInstanceIdHisTask() {
//    TaskService taskService = processEngine.getTaskService();
//    HistoryService historyService = processEngine.getHistoryService();
//    List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery().processInstanceId("60001").list();
//    for (HistoricTaskInstance historicTaskInstance : list) {
//      System.out.println(historicTaskInstance.getId() + " " + historicTaskInstance.getTaskDefinitionKey() + " " + historicTaskInstance.getEndTime() + " " + historicTaskInstance.getAssignee());
//    }
//  }
//
//
//}
